"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"plt.subplots(1,2, figsize=(20, 10))\n",
"plt.subplot(1,2,1)\n",
"plt.imshow(image)\n",
"plt.axis('off')\n",
"plt.subplot(1,2,2)\n",
"plt.imshow(refined_image)\n",
"plt.axis('off')\n",
"plt.tight_layout()"
]
},
{
"cell_type": "markdown",
"id": "0222448f-2864-4b7d-a36f-499792b83e93",
"metadata": {
"id": "0222448f-2864-4b7d-a36f-499792b83e93"
},
"source": [
"In memory-reduced environments, the results are limited. However with more powerful compute, SDXL can generate very detailed images up to 1024x1024, such as the ones below, and more advanced tasks such as [in-painting](https://huggingface.co/docs/diffusers/en/using-diffusers/sdxl#inpainting) or generating more specific outputs using other models like Controlnet, Dreambooth, or adapters.\n",
"\n",
"\n",
"\n",
"You can see it in action at the Hugging Face space backed by TPU from Google here: https://huggingface.co/spaces/google/sdxl\n",
"\n",
"There is also [SDXL Lightning](https://huggingface.co/ByteDance/SDXL-Lightning), which is a model from ByteDance based upon SDXL, and generates images even faster than the original model."
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "b2a89b13-8801-43f8-9812-3c6603359551",
"metadata": {
"id": "b2a89b13-8801-43f8-9812-3c6603359551"
},
"outputs": [],
"source": [
"# Clean up\n",
"del refiner\n",
"\n",
"# Clear cache and free up RAM\n",
"gc.collect()\n",
"torch.cuda.empty_cache()"
]
},
{
"cell_type": "markdown",
"id": "860c117b-0ae0-4988-9fee-b8a0abba0a52",
"metadata": {
"id": "860c117b-0ae0-4988-9fee-b8a0abba0a52"
},
"source": [
"----\n",
"\n",
"